﻿<%@ WebHandler Language="C#" Class="DeleteAttachmentsDnd" %>

using System;
using System.Web;
using System.IO;

public class DeleteAttachmentsDnd : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
      
        context.Response.ContentType = "text/plain";


        string UploadFiles = context.Request.Params["UploadFiles"];
        string foldername = HttpContext.Current.Server.MapPath("~/Webservices/upload/");
        string FilePath = foldername + UploadFiles;
        System.IO.FileInfo FName = new System.IO.FileInfo(FilePath);
        decimal s1 = FName.Length;
        decimal size = s1 / 1000;
        System.IO.File.Delete(foldername + "\\" + UploadFiles);

    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}